﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Media.Imaging;

namespace SLLottery.Controls
{
    public partial class LotteryBall : UserControl
    {
        public LotteryBall()
        {
            InitializeComponent();
        }
        public string Text
        {
            get
            {
                return this.tb.Text;
            }
            set
            {
                this.tb.Text = value;
            }
        }
        public BallColor BallColor
        {
            get
            {
                return Controls.BallColor.Blue_Big;
            }
            set
            {
                ImageBrush imageBrush = new ImageBrush();
                switch (value)
                {
                    case Controls.BallColor.Red_Big:
                        imageBrush.ImageSource =  new BitmapImage(new Uri("/SLLottery;component/Images/red_b.png", UriKind.Relative));
                        this.Ball.Background = imageBrush;
                        this.Ball.Width = 41;
                        this.Ball.Height = 41;
                        this.tb.Width = 25;
                        this.tb.Height = 25;
                        this.tb.FontSize = 18;
                        break;
                    case Controls.BallColor.Blue_Big:
                        imageBrush.ImageSource =  new BitmapImage(new Uri("/SLLottery;component/Images/blue_b.png", UriKind.Relative));
                        this.Ball.Background = imageBrush;
                        this.Ball.Width = 41;
                        this.Ball.Height = 41;
                        this.tb.Width = 25;
                        this.tb.Height = 25;
                        this.tb.FontSize = 18;
                        break;
                    case Controls.BallColor.Red_Small:
                        imageBrush.ImageSource =  new BitmapImage(new Uri("/SLLottery;component/Images/red.png", UriKind.Relative));
                        this.Ball.Background = imageBrush;
                        this.Ball.Width = 21;
                        this.Ball.Height = 21;
                       this.tb.Width = 16;
                        this.tb.Height = 16;
                        this.tb.FontSize = 10;
                        this.tb.FontWeight = FontWeights.Normal;
                        break;
                    case Controls.BallColor.Blue_Small:
                        imageBrush.ImageSource = new BitmapImage(new Uri("/SLLottery;component/Images/blue.png", UriKind.Relative));
                        this.Ball.Background = imageBrush;
                        this.Ball.Width = 21;
                        this.Ball.Height = 21;
                       this.tb.Width = 16;
                        this.tb.Height = 16;
                        this.tb.FontSize = 10;
                        this.tb.FontWeight = FontWeights.Normal;
                        break;
                }
            }
        }
    }
    public enum BallColor
    {
        Red_Big=0,
        Blue_Big=1,
        Red_Small=2,
        Blue_Small=3
    }

}
